import { BasicColumn, FormSchema } from '@/components/Table';
import { h } from 'vue';
import { Switch, Tag } from 'ant-design-vue';
import { getLevelSelectsApi, getCategorySelectsApi } from '@/api/sys/common';

import { useMessage } from '@/hooks/web/useMessage';
import { downApi, upApi } from '@/api/sys/user';

type CheckedType = boolean | string | number;
export const columns: BasicColumn[] = [
  {
    title: '成员名称',
    dataIndex: 'userName',
  },
  {
    title: '职级',
    dataIndex: 'levelName',
  },

  {
    title: '累计时长(分钟)',
    dataIndex: 'readTimes',
    width: 120,
  },

  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 180,
  },
];

export const yearColumns: BasicColumn[] = [
  {
    title: '年份',
    field: 'date',
    align: 'center',
  },
  {
    title: '时长(分钟)',
    field: 'duration',
    align: 'center',
  },

  {
    width: 150,
    title: '操作',
    align: 'center',
    slots: { default: 'action' },
    fixed: 'right',
  },
];
export const monthColumns: BasicColumn[] = [
  {
    title: '月份',
    field: 'date',
    align: 'center',
  },
  {
    title: '时长(分钟)',
    field: 'duration',
    align: 'center',
  },

  /*  {
    width: 150,
    title: '操作',
    align: 'center',
    slots: { default: 'action' },
    fixed: 'right',
  }, */
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'keyword',
    label: '成员名称',
    component: 'Input',
    colProps: { span: 8 },
  },
  // {
  //   field: 'isRead',
  //   label: '是否参与读书',
  //   component: 'Select',
  //   componentProps: {
  //     options: [
  //       { label: '否', value: '0' },
  //       { label: '是', value: '1' },
  //     ],
  //   },
  //   colProps: { span: 8 },
  // },
];

export const formSchema: FormSchema[] = [
  {
    field: 'userName',
    label: '成员名称',
    required: true,
    component: 'Input',
  },
  {
    label: '职级',
    field: 'levelName',
    component: 'ApiSelect',
    componentProps: {
      api: getLevelSelectsApi,
      // mode:"multiple",
      resultField: 'data',
      labelField: 'label',
      valueField: 'value',
    },
    required: true,
  },
  // {
  //   field: 'continuousNum',
  //   label: '连续签到天数',
  //   required: true,
  //   component: 'Input',
  // },
  // {
  //   field: 'isRead',
  //   label: '是否参与读书',
  //   component: 'Select',
  //   componentProps: {
  //     options: [
  //       { label: '否', value: 0 },
  //       { label: '是', value: 1 },
  //     ],
  //   },
  // },
];
